					<div class="pagination pagination-centered">
						  <ul>

						  	<!-- prev page -->
						  	<?php if($page <= 1) {?>
						  		<li class="disabled"><a>&laquo;</a></li>
						  	<?php } else {?>
						  		<li><a href="<?php  echo $url.($page - 1)?>">&laquo;</a></li>
						  	<?php }?>

						  	<!-- pages -->
						  	<?php if($last_page < 8) {?>
						  		<?php  for($i = 1; $i <= $last_page; $i++) { ?>
							    	<?php  if($page == $i) {?>
							    		<li class="active"><a><?php echo $i;?></a></li>
							    	<?php } else {?>
							    		<li><a href="<?php  echo $url.$i;?>"> <?php echo $i;?></a></li>
							    	<?php }?>

							    <?php  } ?>
						  	<?php } else if($page >= 5 && $page <= $last_page - 4) {?>
						  		<li><a href="<?php echo $url."1"?>"> 1 </a></li>
						    	<li><a href="<?php echo $url."2"?>"> 2 </a></li>
						    	<li class="disabled"><a>...</a></li>
							    

								<li><a href="<?php echo $url.($page - 1)?>"> <?php  echo $page - 1;?> </a></li>
						    	<li class="active"><a> <?php  echo $page;?> </a></li>
								<li><a href="<?php echo $url.($page + 1)?>"> <?php  echo $page + 1;?> </a></li>

								<li class="disabled"><a>...</a></li>
								<li><a href="<?php echo $url.($last_page - 1)?>"> <?php  echo $last_page - 1;?> </a></li>
						    	<li><a href="<?php echo $url.($last_page)?>"> <?php  echo $last_page;?> </a></li>
						    <?php  } else if($page < 5) {?>

						    	<?php  for($i = 1; $i < 5; $i++) { ?>
							    	<?php  if($page == $i) {?>
							    		<li class="active"><a><?php echo $i;?></a></li>
							    	<?php } else {?>
							    		<li><a href="<?php  echo $url.$i;?>"> <?php echo $i;?></a></li>
							    	<?php }?>

							    <?php  } ?>

						    	<li><a href="<?php echo $url."5"?>"> 5 </a></li>

								<li class="disabled"><a>...</a></li>
								<li><a href="<?php  echo $url.($last_page - 1)?>"> <?php  echo $last_page - 1;?> </a></li>
						    	<li><a href="<?php  echo $url.($last_page)?>"> <?php  echo $last_page;?> </a></li>

						    <?php  } else if($page > $last_page - 4) {?>
						  		<li><a href="<?php echo $url."1"?>"> 1 </a></li>
						    	<li><a href="<?php echo $url."2"?>"> 2 </a></li>
						    	<li class="disabled"><a>...</a></li>

						    	<?php  for($i = $last_page - 4; $i <= $last_page; $i++) { ?>
							    	<?php  if($page == $i) {?>
							    		<li class="active"><a><?php echo $i;?></a></li>
							    	<?php } else {?>
							    		<li><a href="<?php  echo $url.$i;?>"> <?php echo $i;?></a></li>
							    	<?php }?>

							    <?php  } ?>
						    <?php  }?>

						    <!-- next page -->
						    <?php
						     if($page >= $last_page) {?>
						  		<li class="disabled"><a>&raquo;</a></li>
						  	<?php } else {?>
						  		<li><a href="<?php  echo $url.($page + 1);?>">&raquo;</a></li>
						  	<?php }?>
						  </ul>
						</div>